Skip to content

feat: implement Metric.update() via PATCH /scorers/{id} #505

Open
thiagobomfin-galileo wants to merge 1 commit intomainfrom
feat/sc-52119-metric-update
Open

feat: implement Metric.update() via PATCH /scorers/{id} #505
thiagobomfin-galileo wants to merge 1 commit intomainfrom
feat/sc-52119-metric-update

Conversation

@thiagobomfin-galileo
Copy link
Contributor

@thiagobomfin-galileo thiagobomfin-galileo commented Mar 13, 2026

User description

Shortcut:

Implement Missing CRUD Operations in future Package

Description:

  • Implements Metric.update() in the future domain layer, replacing a NotImplementedError stub that
    incorrectly claimed the API didn't support scorer updates
  • Wires up the existing but unused update_scorers_scorer_id_patch endpoint (PATCH /scorers/{id}) with
    a partial-update pattern using UNSET-aware request bodies

Tests:

  • Unit Tests Added
  • E2E Test Added (if it's a user-facing feature, or fixing a bug)

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Implement Metric.update to send partial changes through the update_scorers_scorer_id_patch endpoint via UpdateScorerRequest, validating request fields, handling sync states, and refreshing the metric instance on success or failure. Cover the new behavior with tests that assert validation safeguards, proper API requests, and state transitions for both success and failure.

TopicDetails
Metric update Implement Metric update flow by validating permitted fields, guarding against local or deleted metrics, and calling the patched scorer endpoint so the instance refreshes its synced state on success.
Modified files (1)
  • src/galileo/__future__/metric.py
Latest Contributors(2)
UserCommitDate
thiago.bomfin@galileo.airefactor-moving-projec...March 19, 2026
jweiler@galileo.aifeat-Make-code-validat...January 16, 2026
Validate update Validate Metric.update through tests for local/unsynced/deleted guards, invalid inputs, successful API interaction, and failure handling to ensure sync state updates.
Modified files (1)
  • tests/future/test_metric.py
Latest Contributors(2)
UserCommitDate
jweiler@galileo.aifeat-Make-code-validat...January 16, 2026
nachiket@galileo.aifeat-Metric-Future-Pac...October 31, 2025
This pull request is reviewed by Baz. Review like a pro on (Baz).

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.39%. Comparing base (66e86cd) to head (e3ba6db).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/galileo/__future__/metric.py 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
+ Coverage   82.13%   82.39%   +0.25%     
==========================================
  Files          96      103       +7     
  Lines        9282     9438     +156     
==========================================
+ Hits         7624     7776     +152     
- Misses       1658     1662       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thiagobomfin-galileo thiagobomfin-galileo force-pushed the feat/sc-52119-metric-update branch from b8b1d73 to 4df5469 Compare March 17, 2026 18:03
test(future): add TestMetricUpdate covering all guard conditions and the update flow
@thiagobomfin-galileo thiagobomfin-galileo force-pushed the feat/sc-52119-metric-update branch from f2166b5 to e3ba6db Compare March 19, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant